import request from '@/utils/request'

export function selectAgreementList(query){
  return request({
    url: '/agreement/selectAgreementList',
    method: 'get',
    params: query
  })
}

export function selectAgreementById(id){
  return request({
    url: '/agreement/selectAgreementById/' + id,
    method: 'get'
  })
}

export function selectValidAgreementList(query){
  return request({
    url: '/agreement/selectValidAgreementList',
    method: 'get',
    params: query
  })
}

export function insertAgreement(data) {
  return request({
    url: '/agreement',
    method: 'post',
    data: data
  })
}

export function updateAgreement(data){
  return request({
    url: '/agreement',
    method: 'put',
    data: data
  })
}

export function deleteAgreement(id){
  return request({
    url: '/agreement/' + id,
    method: 'delete'
  })
}

export function deleteAgreements(ids){
  return request({
    url: '/agreement/deleteAgreements/' + ids,
    method: 'delete'
  })
}

export function selectMaxEndDateAgreementList(query){
  return request({
    url: '/agreement/selectMaxEndDateAgreementList',
    method: 'get',
    params: query
  })
}

export function exportMaxEndDateAgreement(query){
  return request({
    url: '/agreement/export',
    method: 'get',
    params: query
  })
}
